package com.uhuijia.persistence.usersmall.dao;

import java.util.List;
import java.util.Map;


import org.apache.ibatis.annotations.Param;

import com.uhuijia.persistence.base.annotation.IticDBDao;
import com.uhuijia.persistence.base.dao.CrudDao;
import com.uhuijia.persistence.usersmall.basedao.UsersMallMapper;
import com.uhuijia.pojo.usersmall.model.UsersMall;
import com.uhuijia.pojo.usersmall.model.UsersMallExample;
import com.uhuijia.pojo.usersmall.vo.Condition;


@IticDBDao
public interface UsersMallDao
     extends UsersMallMapper,CrudDao<UsersMall,UsersMallExample> {

	boolean updateUserMall(@Param("newid")String newid,@Param("id")String id,@Param("userNickName")String userNickName,@Param("unionId")String unionId,@Param("userPhone")String userPhone,@Param("userHeadImg")String userHeadImg,@Param("invitingCode")String invitingCode,@Param("moneyDB")Double moneyDB,@Param("preProfitDB")Double preProfitDB,@Param("totalProfitDB")Double totalProfitDB,@Param("openid")String openid,@Param("invitingId")String invitingId,@Param("successPeopleInt")int successPeopleInt,@Param("type")String type);
	/**
	 * 根据当前用户ID查找所有一级团队用户ID
	 * @param parentId
	 * @return
	 */
	List<String> teamOneUserIds(String parentId);
	UsersMall getByPhone(String phone);

	UsersMall getByUnionid(String unionid);
	
	UsersMall getByOpenid(String openid);
	
	List<UsersMall> getByCondition(Condition condition);
	
	List<UsersMall> getInviteRecordByUserID(Map<String, Object> params);
	int getInviteRecordCount(String userId);
	
	int getCountByCondition(Condition condition);
	/***
	 * 根据date查看用户最近邀请的人数
	 * @param params
	 * @return
	 */
	int getInviteCountByUserAndDays(Map<String, Object> params);
	
	List<Map<String,Object>> findUserConsumeLog(Map<String, Object> params);
	/*List<Map<String,Object>> getInviteRelate();	*/
}